package com.tencet.servlet;

import com.alibaba.druid.support.json.JSONUtils;
import com.tencet.entity.Recharge;
import com.tencet.service.Impl.ReChargeServiceImpl;
import com.tencet.service.RechargeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/rechargeShow")
public class RechargeServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        RechargeService rechargeService = new ReChargeServiceImpl();
        String cardnum = (String) req.getSession().getAttribute("secondAccountNumber");
        List<Recharge> list = rechargeService.rechargeShow(cardnum);
        req.setAttribute("list",list);
        req.getRequestDispatcher("rechargeShow.jsp").forward(req,resp);
    }
}
